package com.his.struts.action;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import com.google.gson.Gson;
import com.his.struts.dao.foods.FoodsDao;
import com.his.struts.dao.foods.FoodsImp;
import com.his.struts.form.CookForm;
/**
 * 退出
 * @author liuyan
 *
 */
public class ExitAction extends DispatchAction {
	FoodsDao foodsDao;
	/**
	 * 用户退出
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 */
	public ActionForward usersExit(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		HttpSession session = request.getSession();
		session.invalidate();
		ActionForward act = mapping.findForward("usersExit");
		return act;
	}
	/**
	 * 医生退出
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	public ActionForward docExit(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		HttpSession session = request.getSession();
		session.invalidate();
		ActionForward act = mapping.findForward("docExit");
		return act;
	}
	
	/**
	 * 管理员退出
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 */
	public ActionForward adminExit(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		HttpSession session = request.getSession();
		session.invalidate();
		ActionForward act = mapping.findForward("adminExit");
		return act;
	}

}